import { lazy } from 'react';
import { LazyComponent } from '@/components';

// layout 组件不做懒加载
import Layout from '@/layouts';

const Home = lazy(() => /** 首页 */ import('@/pages/home'));
const LoginRegistry = lazy(() => /** 登录、注册 */ import('@/pages/pre-home'));
const Activity = lazy(() => /** 优惠活动 */ import('@/pages/activity'));
const ActivityDetail = lazy(() => /** 活动详情 */ import('@/pages/activity/detail'));
const ForgotPwd = lazy(() => /** 忘记密码 */ import('@/pages/forgot-password'));
const Deposit = lazy(() => /** 充值 */ import('@/pages/deposit'));
const Withdraw = lazy(() => /** 取款 */ import('@/pages/withdraw'));
const Mine = lazy(() => /** 我的 */ import('@/pages/mine'));
const Bet = lazy(() => /** 投注相关二级主页面 */ import('@/pages/bet'));
const BetRecord = lazy(() => /** 投注记录 */ import('@/pages/bet/record'));
const CARecord = lazy(() => /** 往来记录 */ import('@/pages/bet/comea-record'));
const Gamenots = lazy(() => /** 游戏公告 */ import('@/pages/bet/gamenots'));
const Info = lazy(() => /** 基本资料 */ import('@/pages/bet/info'));
const AccountSafety = lazy(() => /** 账号安全 */ import('@/pages/bet/safety'));
const Infomation = lazy(() => /** 个人信息 */ import('@/pages/bet/infomation'));
const UpdatePwd = lazy(() => /** 更改登录密码 */ import('@/pages/bet/update-pwd'));
const UpdateFundPwd = lazy(() => /** 更改资金密码 */ import('@/pages/bet/update-fund-pwd'));
const BindMobile = lazy(() => /** 绑定手机号 */ import('@/pages/bet/bind-mobile'));
const BinkEmail = lazy(() => /** 绑定邮箱 */ import('@/pages/bet/bind-email'));

const SystemNots = lazy(() => /** 系统公告 */ import('@/pages/bet/system-nots'));
const NoticeDetail = lazy(() => /** 系统公告详情 */ import('@/pages/bet/notice-detail'));
const Feedback = lazy(() => /** 意见反馈 */ import('@/pages/feedback'));
const FeedbackList = lazy(() => /** 意见反馈列表 */ import('@/pages/feedback/List'));
const FeedbackDetail = lazy(() => /** 意见反馈详情 */ import('@/pages/feedback/Detail'));
const Game = lazy(() => /** 游戏 */ import('@/pages/game'));
const BandList = lazy(() => /** 绑定列表 */ import('@/pages/band-list'));
const AddBand = lazy(() => /** 新增绑定 */ import('@/pages/band-list/AddBand'));
const Invite = lazy(() => /** 邀请页面 */ import('@/pages/bet/invite'));
const WithdrawRecord = lazy(() => /** 提现记录 */ import('@/pages/bet/withdraw-record'));
const AmountTrans = lazy(() => /** 额度转换 */ import('@/pages/bet/amount-trans'));

export const routes = [
  {
    path: '/',
    element: LazyComponent({ lazyChildren: Layout }),
    children: [
      {
        path: '',
        element: LazyComponent({ lazyChildren: Home }),
      },
      {
        path: '/login',
        element: LazyComponent({ lazyChildren: LoginRegistry }),
      },
      {
        path: '/forgot-password',
        element: LazyComponent({ lazyChildren: ForgotPwd }),
      },
      {
        path: '/feedback',
        element: LazyComponent({ lazyChildren: Feedback }),
      },
      {
        path: '/feedback-list',
        element: LazyComponent({ lazyChildren: FeedbackList }),
      },
      {
        path: '/feedback-detail',
        element: LazyComponent({ lazyChildren: FeedbackDetail }),
      },
      {
        path: '/activity',
        element: LazyComponent({ lazyChildren: Activity }),
      },
      {
        path: '/activity/detail/:id',
        element: LazyComponent({ lazyChildren: ActivityDetail }),
      },
      {
        path: '/deposit',
        element: LazyComponent({ lazyChildren: Deposit }),
      },
      {
        path: '/withdraw',
        element: LazyComponent({ lazyChildren: Withdraw }),
      },
      {
        path: '/mine',
        element: LazyComponent({ lazyChildren: Mine }),
      },
      {
        path: 'game/:id',
        element: LazyComponent({ lazyChildren: Game }),
      },
      {
        path: '/band-list',
        element: LazyComponent({ lazyChildren: BandList }),
      },
      {
        path: '/band-add',
        element: LazyComponent({ lazyChildren: AddBand }),
      },
      {
        path: '/bet',
        element: LazyComponent({ lazyChildren: Bet }),
        children: [
          {
            path: 'record',
            element: LazyComponent({ lazyChildren: BetRecord }),
          },
          {
            path: 'come-a',
            element: LazyComponent({ lazyChildren: CARecord }),
          },
          {
            path: 'gamenots',
            element: LazyComponent({ lazyChildren: Gamenots }),
          },
          {
            path: 'info',
            element: LazyComponent({ lazyChildren: Info }),
          },
          {
            path: 'infomation',
            element: LazyComponent({ lazyChildren: Infomation }),
          },
          {
            path: 'system-nots',
            element: LazyComponent({ lazyChildren: SystemNots }),
          },
          {
            path: 'notice-detail',
            element: LazyComponent({ lazyChildren: NoticeDetail }),
          },
          {
            path: 'account-safety',
            element: LazyComponent({ lazyChildren: AccountSafety }),
          },
          {
            path: 'update-pwd',
            element: LazyComponent({ lazyChildren: UpdatePwd }),
          },
          {
            path: 'update-fund-pwd',
            element: LazyComponent({ lazyChildren: UpdateFundPwd }),
          },
          {
            path: 'bind-mobile',
            element: LazyComponent({ lazyChildren: BindMobile }),
          },
          {
            path: 'bind-email',
            element: LazyComponent({ lazyChildren: BinkEmail }),
          },
          {
            path: 'invite/:type',
            element: LazyComponent({ lazyChildren: Invite }),
          },
          {
            path: 'withdraw-record',
            element: LazyComponent({ lazyChildren: WithdrawRecord }),
          },
          {
            path: 'amount-trans',
            element: LazyComponent({ lazyChildren: AmountTrans }),
          },
        ],
      },
    ],
  },
];
